#ifndef LOGINSERVICE_H
#define LOGINSERVICE_H

#include <QObject>
#include <QString>
#include <QByteArray>
#include <QNetworkAccessManager>
#include<QNetworkReply>
#include "config.h"

class LoginService :public QObject
{
    Q_OBJECT
    //属性：用户名
    Q_PROPERTY(QString username READ username WRITE setUsername)
    //属性：密码
    Q_PROPERTY(QString password READ password WRITE setPassword)
public:
    explicit LoginService(QObject *parent = 0);
    QString username();
    void setUsername(QString str);
    QString password();
    void setPassword(QString str);
signals:
    void sig_login_result(int code,QString msg);
public slots:
    //登录请求
    void slot_login_req();
    //登录响应
    void slot_login_res(QNetworkReply *reply);
private:
    QString _username;
    QString _password;
    QNetworkAccessManager *_nam;

};

#endif
